Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for arrays and pluralization to Trans component #1179

Conversation

acidfernando
Copy link
Contributor

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix
[x] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)

Improved Trans component usability to allow dealing with array values and pluralization just as the hook does

Is there anything you'd like reviewers to focus on?

I'm not convinced by the new parameter returnObjects I added to Trans component. Its the same as useTranslation.

Please treat this as a first draft. We can discuss better ways of doing this. If it is a desired feature, I'm glad to keep working on it until we are all satisfied with the outcome.

Copy link
Owner

@aralroca aralroca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @acidfernando LGTM! thanks for you contribution

Please treat this as a first draft. We can discuss better ways of doing this.

I think using the formatElements as you did is the correct way! And it make sense to keep the same field returnObjects as the hook IMO. Great job

@acidfernando
Copy link
Contributor Author

Thanks for your feedback!

I'll let you merge when you think its appropriate

@aralroca aralroca merged commit c215acf into aralroca:master Jan 12, 2024
6 checks passed
@aralroca
Copy link
Owner

@all-contributors please add @acidfernando for code

Copy link
Contributor

@aralroca

I've put up a pull request to add @acidfernando! 🎉

@aralroca
Copy link
Owner

@acidfernando available in 2.7.0-canary.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants